/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.expert.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

import com.chlitina.store.common.persistence.BaseDao;
import com.chlitina.store.common.persistence.BaseDaoImpl;
import com.chlitina.store.modules.expert.entity.SystemDefinitionAreaSeason;

/**
 * 区域季节DAO接口
 * @author lvbo
 * @version 2013-07-02
 */
public interface SystemDefinitionAreaSeasonDao extends SystemDefinitionAreaSeasonDaoCustom, CrudRepository<SystemDefinitionAreaSeason, Long> {

	@Query("select s from SystemDefinitionAreaSeason s, SystemDefinitionAreaSeasonDetail sd where s.area.id=?1" +
			" AND s.id = sd.systemDefinitionAreaSeason.id AND sd.systemDefinitionMonth.id=?2")
	public List<SystemDefinitionAreaSeason> getTodayByArea(Long areaId, Long mouth);
	
}

/**
 * DAO自定义接口
 * @author lvbo
 */
interface SystemDefinitionAreaSeasonDaoCustom extends BaseDao<SystemDefinitionAreaSeason> {

}

/**
 * DAO自定义接口实现
 * @author lvbo
 */
@Component
class SystemDefinitionAreaSeasonDaoImpl extends BaseDaoImpl<SystemDefinitionAreaSeason> implements SystemDefinitionAreaSeasonDaoCustom {

}
